﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="Token.Piker.Web.Admin.Photo.List" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>单张管理</title>
    <style type="text/css">
        .img_holder {
            display: block;
            width: 210px;
            height: 210px;
            margin: 0 5px 5px 0;
            overflow: hidden;
            border: 1px solid #ccc;
            float: left;
        }
    </style>
    <script src="../../js/fancyapps-fancyBox/lib/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        //以下封装对图片进行处理
        function DrawImage(img, W, H) {
            var width = $(img).width();
            var height = $(img).height();
            if (width / height >= W / H) {
                if (width > W) {
                    $(img).height(H);
                    width = width * H / height;
                    $(img).width(width);
                    var margin = (W - width) / 2;
                    $(img).css("margin-left", margin).css("margin-right", margin);
                }
            } else {
                if (height > H) {
                    $(img).width(W);
                    height = height * W / width;
                    $(img).height(height);
                    var margin = (H - height) / 2;
                    $(img).css("margin-top", margin).css("margin-bottom", margin);
                }
            }
        }
        $(document).ready(function () {
            $(".img_holder img").load(function () {
                DrawImage(this, 200, 200);
            });
        });    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:DataList ID="dataList" runat="server" RepeatLayout="Table" RepeatDirection="Horizontal" RepeatColumns="3">
        <ItemTemplate>
            <a class="img_holder" href="Show.aspx?ID=<%# Eval("ID").ToString() %>" title="点击查看图片详细信息">
                <img src="<%# ResolveClientUrl(Eval("CompressUrl_1").ToString()) %>" alt="" /></a>
        </ItemTemplate>
    </asp:DataList>
    <p></p>
    <webdiyer:AspNetPager ID="pagerList" runat="server" Width="95%" NumericButtonCount="6"
        UrlPaging="true" NumericButtonTextFormatString="[{0}]" CustomInfoHTML=" 第 <font color='red'><b>%CurrentPageIndex%</b></font> 页 共 %PageCount% 页 显示 %StartRecordIndex%-%EndRecordIndex% 张"
        ShowCustomInfoSection="left" FirstPageText="首页" LastPageText="末页" NextPageText="下页"
        PrevPageText="上页" Font-Names="Arial" BackColor="#F8B500" AlwaysShow="true" ShowInputBox="Always"
        SubmitButtonText="跳转" OnPageChanged="pagerList_PageChanged" PageSize="9" ReverseUrlPageIndex="True">
    </webdiyer:AspNetPager>
</asp:Content>
